class_name BattleOver
extends Panel

enum Type {WIN, LOSE}

@onready var label: Label = %Label
@onready var continueBtn: Button = %Continue
@onready var restartBtn: Button = %Restart

func _ready() -> void:
  continueBtn.pressed.connect(get_tree().quit)
  restartBtn.pressed.connect(get_tree().reload_current_scene)

func showScreen(text: String, type: Type) -> void:
  label.text = text
  continueBtn.visible = type == Type.WIN
  restartBtn.visible = type == Type.LOSE
  show()
  get_tree().paused = true
